﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Class1
    {
        public static Boolean Judge()
        {
            Console.WriteLine("请输入字符串");
            string character = Console.ReadLine();
            if (character.Length == 0 || character.Trim() == string.Empty)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

    }
    class ArrayUtil
    {

        //2、写一个工具类ArrayUtil，在里面定义一个静态方法，用来判断数组是否为空。
        //如果数组是null，或者数组长度为0，那此方法返回true，否则返回false
        //然后在主类中（有Main方法的类）调用测试。


        //放一个最初的正常数组用来实时更新：
        static int[] arr = new int[5];
        public static Boolean array()
        {
            //让用户选择数组类型if实现(或者用switch)来把用户所选数组更新到最初数组中     
            Console.WriteLine("请选择要判断的数组前的序号：");
            Console.WriteLine("1.int[] arr = null" + "\t" + "2.int[] arr = new int[0]" + "\t " + "3.int[] arr = new int[5];");
            int num2 = Convert.ToInt32(Console.ReadLine());
            if (num2 == 1)
            {
                arr = null;
            }
            else if (num2 == 2)
            {
                arr = new int[0];
            }
            else if (num2 == 3)
            {
                arr = new int[5];
            }
            else
            {
                Console.WriteLine("你选择的序号不符合规范，请重新输入！！！");
                array();
            }

            //开始判断数组类型：
            if (arr == null || arr.Length == 0)
            {
                return true;
            }
            else
            {
                return false;
            }

        }

    }

    class Student
    {
        static string Teacher { get; set; }
        string Studentname { get; set; }
        public Student()
        {
            Teacher = "唐僧";
        }
        public Student(string studentname)
        {
            Teacher = "唐僧";
            this.Studentname = studentname;
        }
        public void EoL6()
        {
            Console.WriteLine("大家好，我是{0}，俺老师叫{1}", this.Studentname, Teacher);
        }

        public static void EoL7()
        {
            Teacher = "嫦娥姐姐";
        }
    }
}
